<template>
	<view>
		<scroll-view scroll-y class="page">
			<cu-custom bgImage="https://image.weilanwl.com/color2.0/plugin/cjkz2329.jpg">
				<block slot="content">
					<p>课程分类</p>
					<!-- <image src="/static/cjkz.png" mode="aspectFill" style="width: 240upx;height: 60upx;"></image> -->
				</block>
			</cu-custom>
			<view class="cu-card">
				<view class="cu-item bg-img shadow-blur" :style="[{backgroundImage:'url('+item.imgUrl+')'}]" @tap="toChild" :data-url="item.query"
				 v-for="(item,index) in studyList" :key="index">
					<view class="cardTitle">
						{{item.title}}
					</view>
				</view>
			</view>
		</scroll-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				url:'../courseList/courseList',
				studyList: []
			}
		},
		methods: {
			toChild(e) {
				let that=this;
				uni.navigateTo({
					url: that.url+'?query='+e.currentTarget.dataset.url
				})
			},
		},
		onLoad:function(){
			uni.showLoading({
				title: '加载中...',
				mask: false
			});
			uni.request({
				url: 'http://localhost:8080/api/studyList',
				method: 'GET',
				data: {},
				success: res => {
					uni.hideLoading();
					this.studyList=res.data
				},
				fail: () => {},
				complete: () => {}
			});
		}
	}
</script>

<style>
	.page {
		height: 100vh;
	}

	.cardTitle {
		color: #fff;
		padding: 90upx 60upx;
		font-size: 40upx;
		font-weight: 300;
		transform: skew(-10deg, 0deg);
		position: relative;
		text-shadow: 0px 0px 6upx rgba(0, 0, 0, 0.3)
	}

	.cardTitle::before {
		content: "";
		position: absolute;
		width: 60upx;
		height: 6upx;
		border-radius: 20upx;
		background-color: #fff;
		display: block;
		top: 60upx;
		left: 50upx;
		transform: skew(10deg, 0deg);
	}

	.cardTitle::after {
		content: "";
		position: absolute;
		width: 140upx;
		border-radius: 6upx;
		height: 24upx;
		background-color: #fff;
		display: block;
		bottom: 76upx;
		left: 90upx;
		transform: skew(10deg, 0deg);
		opacity: 0.1;
	}
</style>
